#pragma once
#include <vector>
#include <map>
#include<memory>
#include <fstream>

class Struct_Data;
class Node_Base;
class Section_Base;
class Element_Base;
class Stress_Base;

class Struct_Result
{
public:
	Struct_Result(const Struct_Data& data);
	bool StressAnalysis();

private:
	std::vector<int> n_Section;
	std::vector<double> p_Section;
	std::vector<std::vector<std::shared_ptr<Node_Base>>> S_Node;
	std::vector<std::vector<std::shared_ptr<Element_Base>>> S_Element;
	std::vector<std::vector<std::shared_ptr<Stress_Base>>> S_Stress;

	std::map<int, std::shared_ptr<Stress_Base>> uStress;
	std::vector<int> nStress;
	std::vector<std::vector<double>> max_Stress;
	std::vector<std::vector<double>> min_Stress;
	std::vector<std::vector<int>> Element_Node;
	std::map<int, int> Node_order;

	const Struct_Data& m_data;

	void ReadSection();
	void getStress();
	void foutStress();

	void SplitSnumber(std::ifstream& fin, std::vector<int>& snumber);
	std::shared_ptr<Section_Base> FindSection(int idEntity);

};

